<html>
<head>
<style type='text/css'>
body {
   background-color: white;
   margin: 1em 2em 1em 2em;
   font-family: Sans-Serif;
   color: #002;
   line-height: 140%;
   font-size: 12px;
}

h4 {
    font-size: 100%;
    font-style: normal;
    font-weight: bold;
}

h5 {
    font-size: 100%;
    font-style: italic;
    font-weight: normal;
}

pre {
   background-color: #eee;
   padding: 0.5em 0.5em 0.5em 2em;
}

@media print {
   pre {word-wrap:break-word; width:100%;}
} 

ul li,
ol li {
   padding-left: 0.3em;
   /*text-indent: -2em;*/
   margin-bottom: 0.5em;
}

em {
   font-style: normal;
   font-weight: bold;
   text-decoration: underline;
   color: #c40;
}

code {
   font-family: Monospace;
   font-size: 100%;
   color: #c40;
}

a, a * {
   text-decoration: underline;
   color: blue;
   /* border: 0.5px solid #aaa;
   white-space: nowrap;
   padding-right: 0.1em;
   padding-left: 0.1em;
   padding-bottom: -5px; */
}

a code {
   color: blue;
}

img {
   position: relative;
   bottom: -4px;
}

div.headline {
   font-weight: bold;
   font-size: 110%;
}

div.copyright {
   margin-top: 1em;
   border-top: 1px solid black;
   padding-top: 0.5em;
}

div.iris_headline {
   border-bottom: 1px solid black;
   padding-bottom: 0.3em;
}

.LaTeX {
   font-family: Monospace;
   font-size: 100%;
   border: 1px solid #060;
   color: #060;
}

code.LaTeX {
   background-color: white;
   padding: 0.5em 0.5em 0.5em 2em;
}
</style>
</head>

<body>
<div class="iris_headline">IRIS Toolbox Reference Manual</div>




<h2 id="model/solve">solve</h2>
<div class="headline">Calculate first-order accurate solution of the model</div>

<h4 id="syntax">Syntax</h4>
<pre><code>M = solve(M,...)</code></pre>
<h4 id="input-arguments">Input arguments</h4>
<ul>
<li><code>M</code> [ model ] - Paramterised model object. Non-linear models must also have a steady state values assigned.</li>
</ul>
<h4 id="output-arguments">Output arguments</h4>
<ul>
<li><code>M</code> [ model ] - Model with newly computed solution.</li>
</ul>
<h4 id="options">Options</h4>
<ul>
<li><p><code>'expand='</code> [ numeric | <em><code>0</code></em> | <code>NaN</code> ] - Number of periods ahead up to which the model solution will be expanded; if <code>NaN</code> the matrices needed to support solution expansion are not calculated and stored at all and the model cannot be used later in simulations or forecasts with anticipated shocks or plans.</p></li>
<li><p><code>'error='</code> [ <code>true</code> | <em><code>false</code></em> ] - Throw an error if no unique stable solution exists; if <code>false</code>, a warning message only will be displayed.</p></li>
<li><p><code>'linear='</code> [ <em><code>'auto'</code></em> | <code>true</code> | <code>false</code> ] - Solve the model using a linear approach, i.e. differentiating around zero and not the currently assigned steady state.</p></li>
<li><p><code>'progress='</code> [ <code>true</code> | <em><code>false</code></em> ] - Display progress bar in the command window.</p></li>
<li><p><code>'refresh='</code> [ <em><code>true</code></em> | <code>false</code> ] - Refresh dynamic links before computing the solution.</p></li>
<li><p><code>'select='</code> [ <em><code>true</code></em> | <code>false</code> ] - Automatically detect which equations need to be re-differentiated based on parameter changes from the last time the system matrices were calculated.</p></li>
<li><p><code>'warning='</code> [ <em><code>true</code></em> | <code>false</code> ] - Display warnings produced by this function.</p></li>
</ul>
<h4 id="description">Description</h4>
<p>The IRIS solver uses an ordered QZ (or generalised Schur) decomposition to integrate out future expectations. The QZ may (very rarely) fail for numerical reasons. IRIS includes two patches to handle the some of the QZ failures: a SEVN2 patch (Sum-of-EigenValues-Near-Two), and an E2C2S patch (Eigenvalues-Too-Close-To-Swap).</p>
<ul>
<li><p>The SEVN2 patch: The model contains two or more unit roots, and the QZ algorithm interprets some of them incorrectly as pairs of eigenvalues that sum up accurately to 2, but with one of them significantly below 1 and the other significantly above 1. IRIS replaces the entries on the diagonal of one of the QZ factor matrices with numbers that evaluate to two unit roots.</p></li>
<li><p>The E2C2S patch: The re-ordering of thq QZ matrices fails with a warning <code>'Reordering failed because some eigenvalues are too close to swap.'</code> IRIS attempts to re-order the equations until QZ works. The number of attempts is limited to <code>N-1</code> at most where <code>N</code> is the total number of equations.</p></li>
</ul>
<h4 id="example">Example</h4>

</body>
<div class="copyright">IRIS Toolbox. Copyright &copy; 2007&#8212;2012 Jaromir Benes.</div>
</html>
